import { ADD_PERSON } from '../constant'
const initState = [{ name: 'hqh', age: 26 }]

export default function PersonReducer(preState = initState, action) {
  const { type, data } = action

  switch (type) {
    case ADD_PERSON:
      return [...preState, data]
    default:
      return preState
  }
}
